package com.liyunc.toolset;

/**
 * Copyright (c) 2018-2023 ThunderSoft
 * All Rights Reserved by Thunder Software Technology Co., Ltd and its affiliates.
 * You may not use, copy, distribute, modify, transmit in any form this file
 * except in compliance with ThunderSoft in writing by applicable law.
 */


/**
 * @author liyuncong
 * @version 1.0
 * @file CmdArgs
 * @brief CmdArgs
 * @details CmdArgs
 * @date 2023-02-16
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2023-02-16                  liyuncong          Created
 */
public class CmdArgs {
    private WorkMode workMode;
    private SearchMode searchMode;
    private String pattern;
    private Integer exitCodePatternFound;
    private Integer exitCodePatternNotFound;
    private Integer killSignal;

    public CmdArgs(
        WorkMode workMode,
        SearchMode searchMode,
        String pattern,
        Integer exitCodePatternFound,
        Integer exitCodePatternNotFound,
        Integer killSignal
    ) {
        this.workMode = workMode;
        this.searchMode = searchMode;
        this.pattern = pattern;
        this.exitCodePatternFound = exitCodePatternFound;
        this.exitCodePatternNotFound = exitCodePatternNotFound;
        this.killSignal = killSignal;
    }

    public CmdArgs parse(String[] arg) {
        return Parser.parseCmdArgs(arg);
    }

    public WorkMode getWorkMode() {
        return workMode;
    }

    public void setWorkMode(WorkMode workMode) {
        this.workMode = workMode;
    }

    public SearchMode getSearchMode() {
        return searchMode;
    }

    public void setSearchMode(SearchMode searchMode) {
        this.searchMode = searchMode;
    }

    public String getPattern() {
        return pattern;
    }

    public void setPattern(String pattern) {
        this.pattern = pattern;
    }

    public Integer getExitCodePatternFound() {
        return exitCodePatternFound;
    }

    public void setExitCodePatternFound(Integer exitCodePatternFound) {
        this.exitCodePatternFound = exitCodePatternFound;
    }

    public Integer getExitCodePatternNotFound() {
        return exitCodePatternNotFound;
    }

    public void setExitCodePatternNotFound(Integer exitCodePatternNotFound) {
        this.exitCodePatternNotFound = exitCodePatternNotFound;
    }

    public Integer getKillSignal() {
        return killSignal;
    }

    public void setKillSignal(Integer killSignal) {
        this.killSignal = killSignal;
    }

    @Override
    public String toString() {
        return "CmdArgs{" +
            "workMode=" + workMode +
            ", searchMode=" + searchMode +
            ", pattern='" + pattern + '\'' +
            ", exitCodePatternFound=" + exitCodePatternFound +
            ", exitCodePatternNotFound=" + exitCodePatternNotFound +
            ", killSignal=" + killSignal +
            '}';
    }
}
